package com.hujun.modules.data;

import com.hujun.modules.dto.BookDTO;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class CustomData {

    public static List<BookDTO> getBookList() {
        List<BookDTO> list = new ArrayList<>();
        BookDTO book = new BookDTO();
        book.setId("1");
        book.setParentId("0");
        book.setName("《前端快速入门》");
        for (int i = 0; i < 5; i++) {
            BookDTO t = new BookDTO();
            t.setId(UUID.randomUUID().toString());
            t.setName("章节" + i);
            t.setParentId(book.getId());
            if (i == 2) {
                BookDTO c = new BookDTO();
                c.setId(UUID.randomUUID().toString());
                c.setName("初识Java");
                c.setParentId(t.getId());
                list.add(c);
            }
            list.add(t);
        }
        list.add(book);
        return list;
    }

}
